# #冒泡排序
# def bubble(bubbleList):
#     listLength = len(bubbleList)
#     print(listLength)
#     while listLength > 0:
#         for i in range(listLength - 1):
#             # print(i)
#             if bubbleList[i] > bubbleList[i + 1]:
#                 print("fdsafdsaf")
#                 print(i+1)
#                 bubbleList[i] = bubbleList[i] + bubbleList[i + 1]
#                 bubbleList[i + 1] = bubbleList[i] - bubbleList[i + 1]
#                 bubbleList[i] = bubbleList[i] - bubbleList[i + 1]
#         listLength =listLength-1
#     print(bubbleList)
#
#
# if __name__ == '__main__':
#     bubbleList = [35,4,0,12]
#     bubble(bubbleList)

# a = [1,3]
# if a[2]>a[3]:
#     print("dsfsda")

import time



def zhengjie(a):
    start = time.time()
    # time.sleep(2)
    alength = len(a)
    temp = 0
    while alength > 0:
        for i in range(0,alength-1):
            if a[i] > a[i+1]:
                temp = a[i]
                a[i] = a[i+1]
                a[i+1] = temp
        alength = alength-1
    end = time.time()
    shijian  = start -end
    print(shijian)
    print("时间是%f" % (start-end))
    print(a)



if __name__ == '__main__':
    a = [35,4,0,12,7,0,12,7,78,7,0,12,7,78,7,0,12,7,78,7,0,12,7,78,7,0,12,7,78,7,0,12,7,78,7,0,12,7,78,7,0,12,7,78,7,0,12,7,78,7,0,12,7,78,7,0,12,7,78,7,0,12,7,78,7,0,12,7,78,7,0,12,7,78,7,0,12,7,78,7,0,12,7,78,7,0,12,7,78,7,0,12,7,78,7,0,12,7,78,778,7,0,0,12,7,78,7,0,12,7,78,7,0,12,7,78,7,0,12,7,78,7,0,12,7,78,7,0,12,7,78,7,0,12,7,78,7,0,12,7,78,7,0,12,7,78,7,0,12,7,78,7,0,12,7,78,7,0,12,7,78,7,0,12,7,78,7,0,12,7,78,7,0,12,7,78,7,0,12,7,78,7,0,12,7,78,7,0,12,7,78,7,0,12,7,78,7,12,7,78,7,0,12,7,78,7,0,12,7,78,7,0,12,7,78,7,0,12,7,78,7]
    zhengjie(a)


